package com.wnxy.mapper;

import com.wnxy.model.Navigation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author alice
 * @since 2021-11-12
 */
public interface NavigationMapper extends BaseMapper<Navigation> {
    @Select("SELECT * from t_navigation nav join t_role_nav rn on nav.nav_id=rn.nav_id JOIN t_manager_role  mr ON mr.role_id=rn.role_id JOIN t_manager m on m.manager_id=mr.manager_id where m.manager_id=#{managerId} ORDER BY nav.nav_pid")
    List<Navigation > findAccountMenu(Integer managerId);
    @Select("SELECT * from t_navigation nav join t_role_nav rn on nav.nav_id=rn.nav_id WHERE rn.role_id=#{roleId}")
    List<Navigation > findNavByRole(Integer roleId);
    @Select("SELECT * from t_navigation nav join t_role_nav rn on nav.nav_id=rn.nav_id ")
    List<Navigation > findNavByRoleRedis();
}
